package com.example.apigateway;

import com.example.apigateway.filter.PermisFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

/**
 * 添加@EnableZuulProxy注解表示开启Zuul的API网关服务功能
 */
@EnableZuulProxy
@SpringBootApplication
public class ApiGatewayApplication {

	public static void main(String[] args) {
		SpringApplication.run(ApiGatewayApplication.class, args);
	}

	/**
	 * 声明过滤器
	 * @return
	 */
	@Bean
	PermisFilter permisFilter() {
		return new PermisFilter();
	}

}
